package 数组;

public class arrmax
{
    public static void main(String[] args) {
        int arr[]={15,9000,10000,20000,9500,-5};
        int max = getmax(arr);
        System.out.println("最大值是："+ max);
    }

    public static int getmax(int arr[])
    {
        int max = arr[0];
        for(int i = 1; i<arr.length;i++)
        {
            if(arr[i]>max)
            {
                max = arr[i];
            }
        }
        return max;
    }

}
